package com.itheima.test1;

import java.util.Random;

public class Test2 {
    public static void main(String[] args) {
        Random r = new Random();
        int[] arr = new int[10];
        int sum = 0;
        for (int i = 0; i < 10; i++) {
            arr[i] = r.nextInt(100) + 1;
        }
        for (int i = 0; i < arr.length; i++) {
            sum = sum + arr[i];
        }
        int avg = sum / arr.length;
        int count = 0;
        for (int i = 0; i < arr.length; i++) {
            if(arr[i]<avg){
                count++;
            }
        }

        System.out.println("所有数据的和为："+sum);
        System.out.println("所有数据的平均数为："+avg);
        System.out.println(count);

    }
}
